package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface NursingProjectMapper {
    /**
     * 查询护理项目列表
     *
     * @param name
     * @param status
     * @return
     */
    Page<NursingProject> findNursingProject(@Param("name") String name, @Param("status") Integer status);

    /**
     * 查询护理项目关联次数
     *
     * @param ids
     * @return
     */
    @MapKey("projectId")
    List<Map<String, Object>> findRefCount(@Param("ids") List<Long> ids);

    /**
     * 新增护理项目
     *
     * @param nursingProject
     */
    void addNursingProject(NursingProject nursingProject);

    /**
     * 根据id查询详情
     *
     * @param id
     * @return
     */
    NursingProject findById(Long id);

    /**
     * 修改护理项目详情
     *
     * @param nursingProject
     */
    void modifyNursingProject(NursingProject nursingProject);
}
